<?php 
	session_start();

	if (isset($_SESSION['username']) && isset($_SESSION['uid'])) {
		require('../../Controller/MaintainSystem_controller.php');
		$admin = new MaintainSystem();
		$account = $_SESSION['username'];
		$uid = $_SESSION['uid'];
		if($admin->checkUser($account, $uid)) {
			
			//修改留言資料
			$mid = $_POST["mid"];
			$msg_cont = $_POST["msg_cont"];
			$admin->editMessage($mid, $msg_cont);
			header("location:./Message.php");
		}else {
			header("location:../../login.php");
		}	
	}else {
		header("location:../../login.php");
	}
	
?>